package easy;

public class Solution_367 {
    public static boolean isPerfectSquare(int num) {
        if (num<2) return true;
        int start = 2, end = num/2;
        while (true) {
            int mid = (start + end)/2;
            int mod = num/mid;
            if (mod > mid) {
                start = mid + 1;
            } else if (mod < mid){
                end = mid;
            } else {
                return num%mid==0?true:false;
            }
            if (start>=end) return false;
        }
    }

    public static void main(String[] args) {
//        System.out.println(isPerfectSquare(1));
//        System.out.println(isPerfectSquare(16));
//        System.out.println(isPerfectSquare(14));
//        System.out.println(isPerfectSquare(5));
//        System.out.println(isPerfectSquare(808201));
        System.out.println(1<<2);
    }
}
